# Maintainer: Andrzej Giniewicz <gginiu@gmail.com>
# Contributor: Butui Hu <hot123tea123@gmail.com>

pkgname=python-threadpoolctl
pkgver=3.1.0
pkgrel=2
pkgdesc="Python helpers to limit the number of threads used in native libraries that handle their own internal threadpool"
arch=('any')
url="https://github.com/joblib/threadpoolctl"
license=('BSD')
depends=('python')
makedepends=('python-build' 'python-installer' 'python-flit-core')
source=("https://files.pythonhosted.org/packages/source/t/threadpoolctl/threadpoolctl-${pkgver}.tar.gz")
sha256sums=('a335baacfaa4400ae1f0d8e3a58d6674d2f8828e3716bb2802c44955ad391380')

build() {
  cd "$srcdir"/threadpoolctl-${pkgver}
  python -m build --wheel --no-isolation
}

package() {
  cd "$srcdir"/threadpoolctl-${pkgver}
  python -m installer --destdir="$pkgdir" dist/*.whl
  install -Dm644 LICENSE "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
}
